package com.li.cong.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class DemoController {
    @Autowired
    private RestTemplate restTemplate;
    @RequestMapping("/hi")
    public String test(){
        String result="";
        for(int i=0;i<100;i++){
            result=restTemplate.getForObject("http://demoservice/test",String.class);
            System.out.println(result);
        }
        return result;
    }
}
